//
//  BankCardListBottomView.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/5.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "BankCardListBottomView.h"

@implementation BankCardListBottomView

- (id)initWithInSuperView:(UIView *)aSuperView
{
    if (self = [super initWithInSuperView:aSuperView]) {
        
        [self mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(aSuperView);
            if (iPhoneX) {
                make.bottom.equalTo(aSuperView).offset(-kHeightProportion_In_iPhoneTriploid(34));
            } else {
                make.bottom.equalTo(aSuperView);
            }
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(44)));
        }];
        
        GLGWButton *btn = [[GLGWButton alloc] initWithTitleLableFontType:SYSTEMFONT(16) titleColor:[UIColor colorWithHexString:@"#FFFFFF"] inSuperView:self];
        [btn setBackgroundImage:[UIImage imageWithStartColor:[UIColor colorWithHexString:@"#A89A60" alpha:1] endColor:[UIColor colorWithHexString:@"#A89A60" alpha:0.8]] forState:UIControlStateNormal];
        [btn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(44)));
        }];
        [btn setTitle:@"添加银行卡"];
        [btn addTarget:self action:@selector(addCard:) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

- (void)addCard:(GLGWButton *)sender
{
    if (self.BlockAddCard) {
        self.BlockAddCard(sender);
    }
}

@end
